using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserCustomDetails : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            
        }

    }

    public override Acms.Bll.Role.Roles[] AllowedRoles
    {
        get { return new Acms.Bll.Role.Roles[] { Acms.Bll.Role.Roles.Developer, Acms.Bll.Role.Roles.MembershipAdministrator, Acms.Bll.Role.Roles.MembershipViewer}; }
    } 

    private int userId;

    public int UserId
    {
        get { return userId; }
    }

    private Acms.Bll.User user;
    protected Acms.Bll.User User
    {
        get
        {
            if (user == null && UserId > 0)
                user = Acms.Bll.User.GetById(UserId);
            return user;
        }
    }

    protected override object SaveViewState()
    {
        ViewState["CurrentUserId"] = userId;
        return base.SaveViewState();
    }

    protected override void LoadViewState(object savedState)
    {
        base.LoadViewState(savedState);
        if(ViewState["CurrentUserId"] is int)
            userId = (int)ViewState["CurrentUserId"];
    }

    protected void dlCustomProperties_DataBinding(object sender, EventArgs e)
    {
        dlCustomProperties.DataSource = User.CustomProperties;
    }
}
